#ifndef LINEARREGRESSION_H
#define LINEARREGRESSION_H
#include <vector>

class LinearRegression
{
    struct point{
        double x;
        double y;
    };

private:
    double w_;
    double b_;
    double tW_{3};
    double tB_{5.5};
    std::vector<point> datas;
public:
    LinearRegression(double w, double b);
    void Run();
private:
    double ModelValue(double x);// 线性模型
    double CalcCostJ();// 计算成本
    void CalcGradientDescent();// 计算梯度
private:
    double GetTestY(double x);
};

#endif // LINEARREGRESSION_H
